﻿using System;
using ProtoBuf;
using ZyGames.Framework.Game.Context;
using ZyGames.Framework.Model;

namespace GameServer.Script.Model
{
	[Serializable, ProtoContract]
	[EntityTable("ConnData")]
	public class GameUser : BaseUser
	{
		[ProtoMember(1)]
		[EntityField(true)]
		public int UserId { get; set; }

		[ProtoMember(2)]
		[EntityField]
		public String NickName
		{
			get;
			set;
		}

		[ProtoMember(3)]
		[EntityField]
		public String PassportId
		{
			get;
			set;
		}

		[ProtoMember(4)]
		[EntityField]
		public String RetailId
		{
			get;
			set;
		}

		[ProtoMember(5)]
		public int CurrRoleId { get; set; }

		public string SId { get; set; }

		protected override int GetIdentityId()
		{
			return UserId;
		}

		public override int GetUserId()
		{
			return UserId;
		}

		public override string GetNickName()
		{
			return NickName;
		}

		public override string GetPassportId()
		{
			return PassportId;
		}

		public override string GetRetailId()
		{
			return RetailId;
		}

		public override bool IsLock
		{
			get { return false; }
		}

		public override DateTime OnlineDate
		{
			get;
			set;
		}
	}
}